<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" bgImage="https://image.weilanwl.com/color2.0/plugin/qpct2148.jpg"><block slot="content">个人中心</block></cu-custom>
		<view class="flex flex-direction header">
			<view class="cu-avatar xl round margin-left" 
			     :style="[{
					 'background-image': `url(${avater})`
				 }]">
				 <view class="cu-tag badge cuIcon-crownfill bg-red"></view>
			</view>
			<view class="info">{{info}}</view>
		</view>
		<view class="cu-list menu" :class="[menuBorder?'sm-border':'',menuCard?'card-menu margin-top':'']">
			<view class="cu-item" :class="menuArrow?'arrow':''" @click="toPage('/pages/my-handle-lawcase/my-handle-lawcase')">
				<view class="content">
					<text class="cuIcon-circlefill text-orange"></text>
					<text class="text-grey">我的经办案件</text>
				</view>
			</view>
			<view class="cu-item" :class="menuArrow?'arrow':''">
				<view class="content">
					<text class="cuIcon-settings text-pink"></text>
					<text class="text-grey">个人信息</text>
				</view>
			</view>
			<view class="cu-item margin-top text-center" >
				<view class="content">
					<text class="text-orange">退出登录</text>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import imageCache from '@/common/localStorage/image.js'
	export default {
		data() {
			return {
				avater: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
				// avater: '',
				// avater: "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563204018655&di=dfd89fa974f83dd8897f2d4364fbb864&imgtype=0&src=http%3A%2F%2Fm.360buyimg.com%2Fpop%2Fjfs%2Ft23434%2F230%2F1763906670%2F10667%2F55866a07%2F5b697898N78cd1466.jpg",
				info: "贵阳市房屋产权监理处XXXXX",
				menuBorder: true,
				menuArrow: true,
				menuCard: false,
			}
		},
		// onLoad () {
		// 	console.log("----------------------------")
		// 	imageCache.cache(this.avater, 'avater').then(data => {
		// 		console.log('>>>>>>>>>>>>>..', data)
		// 		this.avater = data.data.tempFilePath
		// 		console.log('////////////', this.avater)
		// 	}, reject => {
		// 		console.log('>>>>>>>>>>>>>..', reject)
		// 	})
		// },
		methods: {
			toPage(url) {
				if (url) {
					uni.navigateTo({
						url: "/pages/my-handle-lawcase/my-handle-lawcase"
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
.header {
	margin: 20upx;
	padding: 20upx 100upx;
	background: #fff;
	border-radius: 20upx;
	.cu-avatar,
	.info {
		display: flex;
		margin: 5upx auto;
		margin-top: 15upx;
	}
	.cu-avatar {
		border: 1px solid #ddd;
	}
	
}
</style>
